home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
apps
/
698
/
whatis65
/
whatis65.doc
< prev
Wrap
Text File
|
1992-12-02
|
26KB
|
582 lines
WHATIS File Identifier v6.5
Copyright (c)1989-92 by Bill Aycock
WHATIS is a simple program that will identify over 125 different types of
files. It is mouse-driven and easy to use; everything is done from a single
dialog box. Whatis runs in any resolution on any ST or TT, and uses under 18K
of your system's RAM. This version will work as either a standalone program or
as a desk accessory (just rename the program file to .PRG or .ACC as you wish).
When run as a desk accessory, versions 5.2 and up of Whatis can act as a
"Whatis server" - specially-written programs can use Whatis to identify file
types for them! (See the Whatis Server appendix for details.) Starting with
version 5.3, you may also pass a filespec to Whatis on the command line to run
it as a TTP-like program.
Why use Whatis? Let's say you're on your favorite BBS, and download a file
called SUPER.ARC. You fire up your Arc Shell to extract the file, and it says
"I don't know how to handle this file!". Whip out Whatis and take a look, and
you find out the file is really an LHarc archive - the uploader used the wrong
extender! Just rename the file to SUPER.LZH and you're all set.
Another, darker scenario... a virus sneaks into your system and erases your
hard drive's directory. Fortunately, you have a program that can recover your
files - unfortunately, it names all the files FILE0001, FILE0002, and so on!
Spend a little time with Whatis, and you may not figure out each file's
original name, but at least you'll know which are programs, which are .PI1s,
which are Calamus docs... a real help if you need it.
Using Whatis
------------
Either run Whatis as a GEM program or choose Whatis from the Desk menu, and
the Whatis dialog box will appear. Under the title bar you'll see three boxes
for a filename and file type, a file's header bytes, and the header byte
display mode. At the bottom of the dialog are three action buttons, marked
"Choose a file", "Next file", and "Exit".
To use Whatis, either click on "Choose a file" or just press C or Return or
the down arrow. You'll be presented with the GEM file selector; use the file
selector to choose your mystery file. Whatis will read the first few bytes of
the file in question and check if these bytes match a known "signature" of a
specific type of file. (Note: Whatis needs at least eight bytes to make a
reasonable guess of the file type; if your file is too small, you'll see an
error message and you'll get a chance to choose another file.)
Then you'll return to the Whatis box. The small message box in the main
title bar displays the path you selected. The first large box under the title
bar shows the name of the file you chose, its size (in small numbers on the
upper right), and the type of file it is. If Whatis doesn't recognize the file
type, it will show up as "text or data". The next box, labeled "header bytes",
displays the first few bytes of your file. You can view this file header in
either hexadecimal or ASCII form; click the "ASCII" or "HEX" button, as
desired, in the small box under the header byte display, or press the left or
right arrow keys.
If you used any wildcards when you selected your mystery file, the "Next
file" button at the bottom of the screen will be enabled (not grayed out), and
it will be the default button (signified by a thicker border). To check the
next file that matches the filename pattern you chose, simply click this button
or press Return, or the space bar or down arrow. (Note: files matching the
file mask are NOT displayed in alphabetical order; they appear in the same
order as they are on disk.)
From the main dialog you can identify another file, or return to whatever you
were doing by clicking the EXIT button or pressing UNDO or ESCape. Simple!
You can reposition the Whatis dialog anywhere on screen. Click on the title
area in the dialog, hold the mouse button down, and drag the outline wherever
you wish. When you release the button, the Whatis dialog appears in the new
location. If Whatis is running as a resident accessory, the new position is
saved between calls. You may center the dialog on screen by double-clicking
on the title area.
A complete list of the file types Whatis can recognize is included at the end
of this document. Unfortunately, many file types do not contain a unique
signature in the first few bytes; Whatis can't identify such files unless a
certain file type is always a specific size (e.g., Degas .PI? pics).
Note that it _is_ possible to fool Whatis. If a data file happens to start
with the same sequence of bytes as some other file type, it will be identified
incorrectly. It is also difficult to distinguish between certain types of
files - for example, the signatures of low-rez TINY pics, resource files,
Neochrome pictures, and 8-bit Scrunch files look the same, so the ID box lists
all of those types. Low-rez TINY pics produced with Vidi-ST sometimes look
identical to SAVEd BASIC (8-bit) files, so both types are listed in that box.
Whatis and the Command Line
---------------------------
Whatis will accept a file spec on the command line in case you wish to run it
as a TTP-like program. If you pass Whatis a command line, it will display a
list of the file name and type for all matching files. Your command line can
contain a full filespec, or just a path or filename (which may include
wildcards). If you don't include a filename, all files in the path you specify
are checked; if you leave out the path, Whatis will check all the files in your
current directory that match the filename.
Leading and trailing blanks on the command line are ignored, and if you pass
more than one filespec only the last is used. Normally Whatis will pause after
every 23 files and after all files have been displayed, and wait for you to
press a key before continuing. If you press ESC or UNDO at this point, Whatis
will exit even if there are more files to identify. (If you end the command
line with a plus sign ('+'), Whatis will _not_ perform these pauses. See the
section below on setting a default pause mode for more information.)
Command line mode can be useful if you wish to run Whatis from a CLI (command
line interface), or from within a terminal program such as Flash. To run
Whatis from within Flash, enter a command like this on the command line:
Command> exec whatis e:\today\*.*
This command will make Whatis check every file in your E:\TODAY\ folder and
display a line showing the filename and file type. From a real CLI, enter
whatis e:\today\*.*
and Whatis will show you the same display, then wait for you to press a key.
NOTE: If the command line you pass is empty, or contains all blanks or just a
plus sign, Whatis will display its dialog box just as if you had run it as a
standard GEM program. If you've run Whatis as a real TTP program, the mouse
may be turned off when the dialog appears. If this happens, you may be able to
run Whatis using the keyboard equivalents instead of the mouse (UNDO to exit,
RETURN to select a file, etc.). This is different from the behaviour of a real
TTP-only program, which is the reason for the term "TTP-like".
Whatis and Data Diet
--------------------
Data Diet is Double Click Software's excellent program for saving huge gobs
of space on your hard disk. Although Whatis can recognize DD 'dietized' files,
there's a catch- you can't have DD active in your system to find one!! The
reason is simple... Data Diet acts behind the scenes. When a program (e.g.,
Whatis) reads a file, DD quickly and silently decodes the file to its original
form before the program gets the data. That means there's no DD identifier to
find, so Whatis reports the actual file type.
Setting a Default Path and Pause Mode
-------------------------------------
When you run Whatis, the file selector normally comes up preset to the root
directory of the drive Whatis loaded from. But if you normally download files
to a particular folder, it would be more convenient for the file selector to
start out in that folder. You can do this by setting a default path for Whatis
to check. You may also tell Whatis NOT to pause automatically in TTP mode, in
case you're running from a real CLI.
You'll need to use an editor that can edit program files. CodeHead's Lookit!
is great for this, and other programs like MemFile or TinyTool will work too.
Load Whatis into the editor and look near offset $25 from the beginning of the
program (or $3A9 if you've run Whatis through DC-Squish). You'll see the
phrase "Defaults: Pause=Y Path=?:" followed by a bunch of zero bytes. To
turn the default pause mode off, change the 'Y' to any other character. To set
up a default search path, change the ? to the drive of your choice and add a
valid path, ending with a \ character, if you wish. Save the file when you're
done, and next time you load Whatis, the file selector will start up in the
desired path. If the path doesn't exist, Whatis will start out in the root
directory of that drive; if the drive itself isn't present in your system,
Whatis will just start out as if you hadn't set up a default path.
You may view your default settings from the Whatis dialog. To do so, press
the HELP key or click the "Go Ataripro on Compuserve..." text field at the very
bottom of the dialog. The display will cycle between the Go Ataripro message,
a display of your default path, and a display of the command line pause mode.
Credits
-------
Whatis was based on Roy Goldman's Compactor Detector, an 8-bit BASIC program
which identifies files and allows renaming them to have a "standard" extender.
Versions 3.2 and up of Whatis were written in 100% assembler code using HiSoft
DevpacST, and the resource was created using WERCS. The 8-bit version of
Whatis was written in Action!, from the folks at ICD.
I'm always looking for more file types to support in Whatis. If you know of
a particular type of file that always start with the same few bytes, or is
always the same size, leave me a message. And, of course, if you have any
problems, questions, comments, or suggestions, PLEASE let me know!
I hope you find this program useful! If you use it, please send a postcard
(or donation! :-) to me at:
Bill Aycock
2310 North Elm Street
Greensboro, NC 27408-5120
November 12, 1992
CompuServe UserID: 76703,4061
Internet: 76703.4061@compuserve.com
Appendix 1: Version History
---------------------------
v6.5: adds GemView .INF, STraight Fax dial dir .PLT, DB Converter .DCD
and .DCL files (thanks to Gordon Meyer!), ShowMsg SMD files, Warp9
Extend-O-Save modules; allows dialog to be centered
v6.4: adds LJII soft fonts, PageStream 2.2 docs; corrects PAC pics
v6.3: adds 7 kinds of Cubase files (thanks to Frank Zeritsch!), recognizes
'LARC' mode (-lz5-) LZH files and Cal 6.3 data files
v6.2: adds STDCAT (thanks to Walter Cole!), Pack-Ice, and Calligrapher files,
pause mode toggle, displays of defaults/last path used/server actions
v6.1: adds Scanner Manager (thanks to Gordon Meyer!) and LDW Power, Gnu .OLB,
TADS save files, several TeX files (thanks to Christopher Browne!)
v6.0: adds Revolver 'rollout' files (thanks to Tim Patrick!) and WARP9.DAT
v5.9: adds over a dozen new types (thanks mostly to Gordon Meyer!)
v5.8: adds Squeezed and ARJ files, notes GIF version in the ID msg
v5.7: adds Timeworks DTP files (thanks to Ira Brickman!), STalker3 .INF
v5.6: adds Superzap files, notes LZH version in the ID msg
v5.5: adds Joppa Fax files (thanks to Charles Smeton!), larger stack to
correct TTP operation, allows repositioning the dialog
v5.4: adds MWC .RSD files, AS/X files (thanks to Chris Sorensen again!),
allows plus-sign pause character in TTP mode
v5.3: adds command-line TTP-like operation
v5.2: first Whatis Server version; adds Newdesk icons, Software Development
Systems DeskJet and Printer Utility Pak setup files (thanks to Scott
Sanders!), PFX-packed and AFX-compressed files (thanks to Mark Spacek!)
and MSDOS .EXE and .COM files (thanks to Ron Luks!)
v5.1: adds FSM-GDOS OTL, QFM, WID files
v5.0: adds these file types (thanks to Chris Herborth!): Unix compressed,
CG fonts, CPXes, SoftLogik screen bitmaps, several PostScript types
v4.9: adds MIDI (thanks again to Chris Sorensen!) and MasterTracks .MTS
files, size display; logic change for more reliable results w/wildcards
v4.8: adds PGC (thanks to Chris Sorensen!), Cal, Data Diet files
v4.7: adds ZOO and MultiDesk Deluxe files; allows default drive/path
v4.6: adds Opus spreadsheet files, 3 kinds of Wordflair II files;
adds command keys; makes Next button default if valid
v4.5: adds DC Squish files (thanks to Mike Vederman!), Neodesk icon files;
allows wildcards to check a number of files at once
v4.4: adds two Notator file types (thanks to Brian Campbell!)
v4.3: adds DCDesktop icon files (thanks to Jim Ness!); some logic changes
v4.2: adds A-CHART, Seurat, WP macro, HotWire ledgers (thanks Gordon Meyer!)
v4.1: adds PKZIP files, new NEO types, 7 Prism-Paint file types
v4.0: first revision without separate resource file
v3.7: adds IFF files (thanks to Ron Hunt!), QFL files, PageStream fonts
v3.6: adds CAD-3D (thanks to David Ramsden!) and Blink data files
v3.5: adds WordUp & WWST files (thanks to Terry May again!), fsel title,
Calamus .CFN and .CDK files
v3.4: adds IMG, GEM, MCL, and BBS Express ST files (thanks to Terry May!)
and more TNY pic varieties (thanks to Jim Ness!), fixes .SPS
v3.3: single version for PRG or ACC, adds hex/ascii display + 3 file types
v3.2: PRG and ACC versions converted into assembler
v3.1: adds Spectrum Sequence files
v3.0: first dialog box version, adds Magic Shadow Archives
v2.2: adds Super Bootdisk disks (thanks to Harold Brewer!)
v2.1: adds TIFF, .PC?, TINY, and Neo animations (thanks to David Ramsden!)
v2.0: first desk accessory version
v1.5: adds WordPerfect document files
v1.4: adds PageStream documents (thanks to James Parry!)
v1.3: corrects Regent Word files, adds *.* for the standard file selector
v1.2: adds one new file type and some error handling
v1.0: first ST version
Appendix 2: The Whatis Server
-----------------------------
When Whatis is installed as an accessory, specially-written programs can
communicate with Whatis to identify file types. Whatis uses the standard GEM
message-passing routines to provide this service. When the Whatis server
completes a request, the small message area in the main title bar will display
the type of file identified the next time the Whatis dialog appears.
First your application must determine if Whatis is present. Use the GEM
appl_find call for this. NOTE: I recommend using "WHATIS " as the string for
the search; this means Whatis must be named WHATIS.ACC when it is installed,
or the appl_find won't be able to find it! Whatis will be distributed as
WHATIS.ACC from now on to help ensure that it has the proper name, but you
should warn users in your documentation about the naming requirement, or allow
users to specify the application's name.
Once you've determined Whatis's appl_id, your application should send a GEM
message to Whatis with some information about the file. This is the format for
the 16-byte message your application sends to Whatis:
Offset Size Meaning
------ ---- -------
0 word message type, must be 'W?' ($573f)
2 word the appl_id of your application
4 word number of extra bytes (must be zero!!)
6 long address of your data buffer (see notes)
10 long the size of the file in question (see notes)
14 word currently unused; must be zero!
Whatis will determine the file type, and return a message to your application.
This is the format of the message Whatis returns:
Offset Size Meaning
------ ---- -------
0 word message type, will always be 'W?' ($573f)
2 word Whatis's appl_id
4 word number of extra bytes (will always be zero)
6 long address of your data buffer (see notes)
10 long an error code (see notes)
14 word file type ID word (see notes)
Notes:
The data buffer whose address is passed in the message serves a dual purpose.
Your application must read the first 50 bytes of the file into this buffer and
pass its address to Whatis. After identifying the file type, Whatis will use
this same buffer to return a string indicating the file type. (This is the
same string you would see if you identified the file directly from the Whatis
accessory.)
IMPORTANT: If the file is under 50 bytes long, the buffer area should be
padded with nulls.
NOTE: Your application should use an fs_first call to determine the size of
the file in question - DO NOT rely on an fs_next call! In some situations an
fs_next can return the size of a file in compressed form, which may not be
accurate; this may lead to an incorrect identification of the file type. (A
question for anyone using the AFX program included with recent Questor LHARC
utilities: when AFX is installed, do fs_first and fs_next return the actual
file size as if it were not compressed, or the size of the compressed file?)
The error code returned by Whatis can have these values:
Code Meaning
---- -------
0 no error occurred
1 not used (obsolete; formerly odd data buffer address)
2 error: the file is too small to identify
The file type ID returned in the last word of the message is a unique number
corresponding to a particular type of file. If your program needs to do more
than simply display a file type message, you may find it easier to check this
ID number and take appropriate action. Whatis ID numbers are guaranteed not to
change in future versions, and new file types will be assigned new ID numbers
when they are added to Whatis.
Whatis ID numbers are divided into several groups; all IDs with a high byte
of 1 indicate MIDI format files, those with a high byte of 2 are other types of
music-related files, a high byte of 3 means a word processing document, and so
on. An ID number of -1 ($FFFF) indicates that Whatis did not recognize the
type of file. A current list of all ID numbers and the associated file types
follows this section.
IMPORTANT NOTE: Whatis is a copyrighted program. I retain all rights to
Whatis. However, Whatis may be distributed with any program, commercial or
otherwise, that is written to access the Whatis Server, under the following
conditions:
1. Both the Whatis executable and this documentation must be
included with your program. Neither file may be modified in
any way, other than compression with ARC, LHARC, or a similar
program for distribution purposes.
2. The author or distributor of a program that accesses the Whatis
Server must send one complete copy of the program, including all
related files and full documentation, to me at the address listed
above.
Appendix 3: File ID Word/Type Cross-Reference
---------------------------------------------
$1xx -- MIDI format x files...
Note, for MIDI format files the low byte is the ASCII value
corresponding to the format. All $1xx types are reserved.
Currently I know of these three types, but new MIDI format
files following the same pattern will automatically show up:
$130 MIDI format 0 file (.MFF/.MID)
$131 MIDI format 1 file (.MFF/.MID)
$132 MIDI format 2 file (.MFF/.MID)
$2xx -- Other music-related file types
$200 Music Studio .SNG file
$201 MasterTracks Pro .MTS file
$202 Notator song file (.SON)
$203 Notator pattern file (.PAT)
$204 Cubase .ALL/ALB song collection
$205 Cubase .PRT/PRB part file
$206 Cubase .PRN printer driver
$207 Cubase .SET/SEB setting file
$208 Cubase .DRM drum file
$209 Cubase .COM Iterative Phrase Synth file
$20a Cubase .MIX mix file
$3xx -- Word processing/document file types
$300 Calamus .CDK document
$301 Word Writer ST file
$302 PageStream document
$303 Wordflair II document
$304 ST-Writer file
$305 WordUp file
$306 WordPerfect document
$307 Regent Word file
$308 Timeworks Publish .DTP file
$309 Calligrapher document (.CAL)
$30a PageStream 2.2 document
$4xx -- Desktop publishing and font file types
$400 Adobe Font Metrics .AFM file
$401 CompuGraphic font file
$402 SoftLogik Screen Bitmap
$403 PageStream font
$404 encapsulated PostScript (.EPS)
$405 Calamus .CFN font
$406 FSM-GDOS .WID width file
$407 FSM-GDOS .OTL outline font
$408 FSM-GDOS .QFM font metrics file
$409 TeX .dvi device independent file
$40a TeX .fmt preloaded format file
$40b TeX .pk font file
$40c .FNT font file
$40d LaserJet II soft font
$5xx -- Picture, graphics, animation file types
$500 Degas Elite .PC1 pic
$501 Degas .PC2 pic or PostScript .PFB
$502 Degas Elite .PC3 pic
$503 Portfolio .PGC graphics file
$504 Spectrum pic (.SPC or .SPS)
$505 Spectrum Sequence (.SPS) file
$506 compressed KOALA pic
$507 QuickST .QFL file
$508 GIF picture file
$509 TIFF tag image file
$50a Degas .PI1 pic
$50b TINY medium-rez pic
$50c TINY high-rez pic
$50d TINY low-rez pic
$50e Spectrum .SPU pic
$50f 256-color NEO pic
$510 1280x960 NEO pic
$511 640x480 NEO pic
$512 Degas .PI3 pic
$513 Degas .PI2 pic
$514 image file (.IMG)
$515 CAD-3D v1 (.3D) file
$516 CAD-3D v2 (.3D2) file
$517 CAD-3D v3 (.3D3) file
$518 Prism-Paint .BRU brush file
$519 Prism-Paint .CFL fill file
$51a Prism-Paint .MFL fill file
$51b Prism-Paint .PAL palette
$51c Prism-Paint .PNT picture
$51d IFF or DeluxePaint file
$51e NEOCHROME animation
$51f Cyber .SEQ animation
$520 .GEM Metafile
$6xx -- Compressed disk and file types
$600 Super Bootdisk file
$601 SHRINKed disk
$602 DISKCOMMed disk
$603 PKZIP .ZIP file
$604 MASHed file
$605 Magic Shadow Archive (.MSA)
$606 .PAK archive file
$607 ALFCRUNCHed archive
$608 ARCed file
$609 Unix 'compress'ed file
$60a LHarc archive (.LZH)
$60b ZOO archive file
$60c CRUSHed file
$60d AFX compressed file
$60e ARJ compresmsed file
$60f Squeezed file (.?Q?)
$7xx -- Executable file types
$700 ST program or desk accessory
$701 DC Squished program or ACC
$702 Control Panel Extension (.CPX)
$703 PFX-packed program file
$704 MS-DOS .EXE program file
$705 MS-DOS .COM program file
$706 Pack-Ice packed program or ACC
$707 Warp 9 .EXT Extend-O-Save module
$8xx -- Miscellaneous data file types
$800 BLINK .LIB library file
$801 BLINK .PAL palette file
$802 BBS Express ST .COM script
$803 Opus .OPS spreadsheet file
$804 .BTK compiled BackTalk script
$805 DaisyDot .NLQ font
$806 DC DataDiet dietized file
$807 NeoDesk Icon file (.NIC)
$808 HotWire .HOT file
$809 HotWire .LGR ledger file
$80a MichTron BBS .MCL file
$80b MultiDesk Deluxe .MLT file
$80c MultiDesk .MLT file
$80d PINHEAD.DAT file
$80e Kuma/Antic A-CHART data file
$80f Wordflair II record key file
$810 Wordflair II record file
$811 Cal v6 data file
$812 WordPerfect macro file
$813 DC Desktop .ICE icon file
$814 SAVEd BASIC/XE file
$815 SAVEd MAC/65 code
$816 SDX external command
$817 Seurat fill or an 8-bit program
$818 Newdesk Icon Spec (.XIC) file
$819 SDS Deskjet Utils setup file
$81a SDS Printer Utils setup file
$81b MWC RCS .RSD resource definition file
$81c AS/X data file
$81d Joppa FAX! Normal Rez file
$81e Joppa FAX! Fine Rez file
$81f Superzap .ZAP file
$820 STalker 3 .INF file
$821 Hot!Stat configuration file
$822 DESKTOP.INF or NEWDESK.INF file
$823 MugShot .MUG or .INF file
$824 MugShot .MGS data file
$825 .PAC picture file
$826 GEMLABEL .LAB label file
$827 MaxiFile III .CMT comment file
$828 Shredr+ .INF file
$829 Son of SAAS .CFG file
$82a DNS SAAS .CFG file
$82b HotWire .WRK work file list
$82c HotWire .HBL menu block
$82d FastBase .FB database file
$82e CodeKeys .KEY macro file
$82f CodeKeys .LNK link file
$830 CodeKeys .CNF config file
$831 DATADIET.INF file
$832 WARP9.DAT file
$833 Revolver partition 'rollout' file
$834 Scanner Manager data file
$835 LDW Power spreadsheet
$836 GNU C .OLB library file
$837 TADS save file
$838 STDCAT catalog file
$839 ShowMsg .SMD configuration file
$83a GemView .INF file
$83b STraight Fax .PLT dial directory
$83c Database Converter .DCD Data Descriptor file
$83d Database Converter .DCL Data Link file
$9xx -- File types that are hard to distinguish
$900 RSC/TNY/NEO/SCRUNCH/Font file
$901 .TNY or hi-rez .NEO pic
$902 SAVEd BASIC, or a .NEO or .TNY pic
$903 .FNT font or hi-rez .TNY pic
$ffff Any unknown type (presumed to be text or data)
======================================================